package com.google.android.gms.internal;

import java.io.IOException;

public final class zzjo extends zzflm<zzjo> {
    private Integer zzbdh = null;
    private Integer zzbez = null;

    public zzjo() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    /* access modifiers changed from: private */
    /* renamed from: zzq */
    public final zzjo zza(zzflj zzflj) throws IOException {
        int i;
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx == 8) {
                i = zzflj.getPosition();
                int zzcym = zzflj.zzcym();
                switch (zzcym) {
                    case 0:
                    case 1:
                    case 2:
                        this.zzbdh = Integer.valueOf(zzcym);
                        break;
                    default:
                        StringBuilder sb = new StringBuilder(43);
                        sb.append(zzcym);
                        sb.append(" is not a valid enum NetworkType");
                        throw new IllegalArgumentException(sb.toString());
                }
            } else if (zzcxx == 16) {
                i = zzflj.getPosition();
                try {
                    int zzcym2 = zzflj.zzcym();
                    if (zzcym2 != 4) {
                        switch (zzcym2) {
                            case 0:
                            case 1:
                            case 2:
                                break;
                            default:
                                StringBuilder sb2 = new StringBuilder(51);
                                sb2.append(zzcym2);
                                sb2.append(" is not a valid enum CellularNetworkType");
                                throw new IllegalArgumentException(sb2.toString());
                        }
                    }
                    this.zzbez = Integer.valueOf(zzcym2);
                } catch (IllegalArgumentException unused) {
                    zzflj.zzmw(i);
                    zza(zzflj, zzcxx);
                }
            } else if (!super.zza(zzflj, zzcxx)) {
                return this;
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzbdh != null) {
            zzflk.zzad(1, this.zzbdh.intValue());
        }
        if (this.zzbez != null) {
            zzflk.zzad(2, this.zzbez.intValue());
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzbdh != null) {
            zzq += zzflk.zzag(1, this.zzbdh.intValue());
        }
        return this.zzbez != null ? zzq + zzflk.zzag(2, this.zzbez.intValue()) : zzq;
    }
}
